package com.matrix.helper;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;

public class Input {
	private boolean daNhan;
	private int keyDangXuLy;

	public Input() {
		daNhan = false;
		keyDangXuLy = Keys.UNKNOWN;
	}

	public boolean pressKey(int newKey) {
		if (Gdx.input.isKeyPressed(newKey) && (daNhan != true)) {
			daNhan = true;
			keyDangXuLy = newKey;
			return true;
		}
		if (Gdx.input.isKeyPressed(keyDangXuLy) == false) {
			daNhan = false;
		}
		return false;
	}
}
